//
//  BaseTabbarController.m
//  22-homework-QQMV-ALi
//
//  Created by 王道林 on 16/8/13.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "BaseTabbarController.h"
#import "MV-ViewController.h"
#import "ALi-ViewController.h"
#import "BaseNavigationViewController.h"
@interface BaseTabbarController ()

@end

@implementation BaseTabbarController


- (instancetype)init
{
    self = [super init];
    if (self) {
        self.viewControllers = [self createSubVC];
    }
    return self;
}


- (NSMutableArray<UIViewController *> *)createSubVC
{
    NSMutableArray *VCArr = [NSMutableArray array];
    
    MV_ViewController *MVVC = [[MV_ViewController alloc] init];
    BaseNavigationViewController *Navi1 = [[BaseNavigationViewController alloc] initWithRootViewController:MVVC];
    MVVC.navigationItem.title = @"MV";
    MVVC.navigationController.navigationBar.barTintColor = [UIColor cyanColor];
    MVVC.navigationController.navigationBar.translucent = NO;
    Navi1.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"MV" image:[UIImage imageNamed:@"Drawing"] tag:100];
    [VCArr addObject:Navi1];
    
    
    ALi_ViewController *ALiVC = [[ALi_ViewController alloc] init];
    BaseNavigationViewController *Navi2 = [[BaseNavigationViewController alloc] initWithRootViewController:ALiVC];
    ALiVC.navigationItem.title = @"ALi";
    ALiVC.navigationController.navigationBar.barTintColor = [UIColor yellowColor];
    ALiVC.navigationController.navigationBar.translucent = NO;
    Navi2.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"ALi" image:[UIImage imageNamed:@"CityHunter"] tag:200];
    
    [VCArr addObject:Navi2];
    
    
    
    
    
    return VCArr;
}







- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
